package com.justgame.project.generator.template;

import com.justgame.project.generator.enums.TemplateType;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class TemplateResolveManager {
    private final List<ITemplateResolve> resolves;

    public TemplateResolveManager(List<ITemplateResolve> resolves) {
        this.resolves = resolves;
    }

    public ITemplateResolve getResolve(TemplateType templateType){
        return resolves.stream().filter((resolve)->resolve.getType().equals(templateType)).findFirst().orElse(null);
    }
}
